<?php

namespace App\Http\Controllers\View\User;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Log;
use App\Facades\Services\User\WeChatService;
use App\Facades\Services\User\UserService;
class UserController extends Controller
{
    
    public function index()
    {
        // dd(config('wechat.oauth.scopes'));
         
        $user = session('wechat.oauth_user');

        WeChatService::updateUserInfo($user->getOriginal());

        return view('pages.user.index',[
            'user' => $user
            ]);
    }

    public function register(){
        
        $userInfo = UserService::getUserInfo();

        return view('pages.user.add-info',[
            'userInfo' => $userInfo
            ]);
    }

    public function info(){
        $userInfo = UserService::getUserInfo();

        return view('pages.user.info',[
            'userInfo' => $userInfo
            ]);
    }

    public function online(){
        return view('pages.user.online.online');
    }
}
